Primitive Class View.DisplayAnchors

Represents the anchor points of a display element.

Members

TOP_LEFT (Vec2) Top-left anchor point in percent.
TOP_CENTER (Vec2) Center-top anchor point in percent.
TOP_RIGHT (Vec2) Top-right anchor point in percent.
CENTER_LEFT (Vec2) Center-left anchor point in percent.
CENTER (Vec2) Center anchor point in percent.
CENTER_RIGHT (Vec2) Center-right anchor point in percent.
BOTTOM_LEFT (Vec2) Bottom-left anchor point in percent.
BOTTOM_CENTER (Vec2) Bottom-center anchor point in percent.
BOTTOM_RIGHT (Vec2) Bottom-right anchor point in percent.

Functions

__tostring(This) Metafunction.


Members

TOP_LEFT
(Vec2) Top-left anchor point in percent.
TOP_CENTER
(Vec2) Center-top anchor point in percent.
TOP_RIGHT
(Vec2) Top-right anchor point in percent.
CENTER_LEFT
(Vec2) Center-left anchor point in percent.
CENTER
(Vec2) Center anchor point in percent.
CENTER_RIGHT
(Vec2) Center-right anchor point in percent.
BOTTOM_LEFT
(Vec2) Bottom-left anchor point in percent.
BOTTOM_CENTER
(Vec2) Bottom-center anchor point in percent.
BOTTOM_RIGHT
(Vec2) Bottom-right anchor point in percent.

Functions

__tostring(This)
Metafunction. Use tostring(anchors).

Parameters:

  • This DisplayAnchors DisplayAnchors.

Returns:

    string A string showing all anchor points.

Usage:

    local anchors = TEN.View.DisplayAnchors()
    print(tostring(anchors))
    -- or --
    print(anchors)
    -- result:
    -- {
    -- TOP_LEFT: Vec2 { x = 0.0, y = 0.0 }, TOP_CENTER: Vec2 { x = 0.0, y = 0.0 },
    -- ...
    -- }
    
    -- Example with DisplaySprite:
    local sprite = TEN.View.DisplaySprite(Objects.ObjID.MySpriteSequence, 0, Vec2(50, 50), 0, Vec2(100, 100))
    local anchors = sprite:GetAnchors()
    print(anchors)
    -- result:
    -- {
    -- TOP_LEFT: Vec2 { x = 45.0, y = 40.0 }, TOP_CENTER: Vec2 { x = 50.0, y = 40.0 },
    -- ...
    -- }
generated by TEN-LDoc (a fork of LDoc 1.4.6)